/* TAPS Analysis */ 
/* Lapinski et al., "What Do Citizens Want from their Member of Congress?", PRQ */ 
/* April 2016 */ 

clear 
clear matrix 
use "2013release.dta"
svyset [pweight = nov2013wt1] 

/* Table 1: How Important Should X Be?" */ 
gen contact = . 
replace contact = (-1*TUCK21S24)+5 if TUCK21S24 >1 & TUCK21S24 < 5 
gen national = . 
replace national = (-1*TUCK22S24)+5 if TUCK22S24 >1 & TUCK22S24 < 5 
gen local_issue = . 
replace local_issue = (-1*TUCK23S24)+5 if TUCK23S24 >1 & TUCK23S24 < 5 
gen money = . 
replace money = (-1*TUCK24S24)+5 if TUCK24S24 >1 & TUCK24S24 < 5 
gen oversight = . 
replace oversight = (-1*TUCK25S24)+5 if TUCK25S24 >1 & TUCK25S24 < 5 
gen service = . 
replace service = (-1*TUCK26S24)+5 if TUCK26S24 >1 & TUCK26S24 < 5 

svy: tabulate contact 
svy: tabulate national
svy: tabulate local_issue 
svy: tabulate money  
svy: tabulate oversight
svy: tabulate service  

/* Of those contacted: why? */
/* Note that only 13% have contacted a member */ 

svy: tabulate TUCK4S21 

svy: tabulate TUCK6S21_01 /* service: 12% */ 
svy: tabulate TUCK6S21_02 /* info: 24% */ 
svy: tabulate TUCK6S21_03 /* change position: 34% */ 
svy: tabulate TUCK6S21_04 /* support/oppose position: 45% */ 
svy: tabulate TUCK6S21_05 /* other: 20% */ 


/* Table 4: Issue Priorities & Approval */ 

/* Look at issue agreement with the member */ 
/* Data here is coded so that higher values mean more agreement */ 
gen abort_agree = -1*(TUCK225S24)+ 7 if TUCK225S24 > 1 & TUCK225S24 < 7  
gen budget_agree = -1*(TUCK226S24)+ 7 if TUCK226S24 > 1 & TUCK226S24 < 7 
gen col_agree = -1*(TUCK227S24)+ 7 if TUCK227S24 > 1 & TUCK227S24 < 7 
gen crime_agree = -1*(TUCK228S24)+ 7 if TUCK228S24 > 1 & TUCK228S24 < 7 
gen fuel_agree = -1*(TUCK229S24)+ 7 if TUCK229S24 > 1 & TUCK229S24 < 7 
gen econ_agree = -1*(TUCK230S24)+ 7 if TUCK230S24 > 1 & TUCK230S24 < 7 
gen educ_agree = -1*(TUCK231S24)+ 7 if TUCK231S24 > 1 & TUCK231S24 < 7 
gen env_agree = -1*(TUCK232S24)+ 7 if TUCK232S24 > 1 & TUCK232S24 < 7 
gen health_agree = -1*(TUCK233S24)+ 7 if TUCK233S24 > 1 & TUCK233S24 < 7 
gen unemp_agree = -1*(TUCK234S24)+ 7 if TUCK234S24 > 1 & TUCK234S24 < 7 
gen immig_agree = -1*(TUCK235S24)+ 7 if TUCK235S24 > 1 & TUCK235S24 < 7 
gen foreign_agree = -1*(TUCK236S24)+ 7 if TUCK236S24 > 1 & TUCK236S24 < 7 
gen moral_agree = -1*(TUCK237S24)+ 7 if TUCK237S24 > 1 & TUCK237S24 < 7 
gen natsec_agree = -1*(TUCK238S24)+ 7 if TUCK238S24 > 1 & TUCK238S24 < 7 
gen poverty_agree = -1*(TUCK239S24)+ 7 if TUCK239S24 > 1 & TUCK239S24 < 7 
gen taxes_agree = -1*(TUCK240S24)+ 7 if TUCK240S24 > 1 & TUCK240S24 < 7 
gen afghan_agree = -1*(TUCK241S24)+ 7 if TUCK241S24 > 1 & TUCK241S24 < 7 

egen avg_agree = rmean(abort_agree budget_agree col_agree crime_agree fuel_agree econ_agree env_agree health_agree unemp_agree immig_agree foreign_agree moral_agree natsec_agree poverty_agree taxes_agree afghan_agree)

/* Approve of Own Member (higher values = more approval) */ 
gen approve_member = -1*(APPRHOUS24) + 6 if APPRHOUS24 > 1 & APPRHOUS24 < 6 
gen approve_binary = .  
replace approve_binary = 1 if approve_member == 3 | approve_member == 4 
replace approve_binary = 0 if approve_member == 1 | approve_member == 2 


/* Respondent Partisanship */ 
gen pid = . 
replace pid = 1 if PARTYID1S20 == 2 & PARTYID2S20 == 2 
replace pid = 2 if PARTYID1S20 == 2 & PARTYID2S20 == 3
replace pid = 3 if PARTYID1S20 >3 & PARTYID3S20 == 2 
replace pid = 4 if PARTYID1S20 >3 & PARTYID3S20 == 1
replace pid = 5 if PARTYID1S20 >3 & PARTYID3S20 == 3 
replace pid = 6 if PARTYID1S20 == 3 & PARTYID2S20 == 3 
replace pid = 7 if PARTYID1S20 == 3 & PARTYID2S20 == 2 

gen dem = 0 
replace dem = 1 if pid < 4 

/* Perceived Member Party */ 

gen memb_party = . 
replace memb_party = 1 if HRPRTYS24 == 2 
replace memb_party = 2 if HRPRTYS24 == 3 

gen party_match = 0 
replace party_match = 1 if memb_party == 1 & dem == 1 
replace party_match = 1 if memb_party == 2 & dem == 0 

/* Think National Issues are Very Important */ 
gen national_vi = . 
replace national_vi = 1 if national == 3 
replace national_vi = 0 if national < 3 

/* Table 4, Column 1 */ 
svy: logit approve_binary party_match c.avg_agree##national_vi 

/* Table 4, Column 2 */ 
svy: logit approve_binary party_match##national_vi c.avg_agree 
svy: mean approve_binary, over(party_match national_vi) 

